<html>
<head>
    <title>实现图片的毛玻璃效果</title>
    <style>
        .background {
            width: 260px;
            height: 200px;
            overflow: hidden;
        }

        .background-content {
            width: 260px;
            height: 100%;
            position: relative;
            /* 让图片居中显示 */
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .background-content-image {
            position: absolute;
            /* 重点，不能让背景大过于展示的图片 */
            z-index: -1;
            width: 260px;
            height: 100%;
            filter: blur(8px);
            background-image: url("../src/assets/NB.jpg");
            background-size: 100%;
            background-position: center;
            background-repeat: no-repeat;
        }

        img {
            max-height: 100%;
        }
        .by_self{
            width: 500px;
            height: 350px;
            margin: 50 auto;
        }
        .content{
            width: 500px;
            height: 100%;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
        }
        .image{
            position: absolute;
            z-index: -1;
            filter: blur(8px);
            width: 500px;
            height: 100%;
            background-image: url("../src/assets/NB.jpg");
            background-size: 100%;
            background-position: center;
            background-repeat: no-repeat;
        }
        .photo{
            max-height: 100%;
        }

    </style>
</head>

<body>
    <!-- <div class="background">
        <div class="background-content">
            <div class="background-content-image"></div>
            <img src="https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp"
                alt="测试图片" />
        </div>
    </div> -->
    
    <div class="by_self">
        <div class="content">
            <div class="image"></div>
            <img class="photo" src="../src/assets/NB.jpg" alt="">
        </div>
    </div>
    <script>
        // 判断日期是不是工作日
        const isWeekday = (date) => date.getDay() % 6 !== 0;
        console.log(isWeekday(new Date(2022-2-9)));
        // console.log(new Date(2021-12-20).getDay());
    </script>
</body>

</html>

<!-- 作者：dinglin
链接：https://juejin.cn/post/7034037550809366535
来源：稀土掘金
著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。 -->